<style lang="scss" >
.remote-api-viewer {
  .vue-code-mirror__con {
    max-height: 30em;
    overflow: auto;
  }
}
</style>

<template>
<div class="remote-api-viewer">
  <vue-code-mirror v-if="js" :js="js"></vue-code-mirror>
</div>
</template>

<script>
import VueCodeMirror from "@example/components/VueCodeMirror";
export default {
  name: "RemoteApiViewer",
  components: {VueCodeMirror},
  props: {
    url: String
  },
  mounted() {
    this.load()
  },
  data() {
    return {
      res: {},
      js: null
    }
  },

  methods: {
    async load() {
      console.log(this.url)
      let f = await globalThis.Req.get(this.url  + '?v=' + ZY.rid() , {
      })
      // console.log(f)
      this.js = ZY.JSON5.stringify(f.result, null, 2)
    }
  }
}
</script>


